home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / tigeroad.c < prev    next >
C/C++ Source or Header  |  2000-04-23  |  34KB  |  861 lines

  1. /***************************************************************************
  2.  
  3. Tiger Road (C) 1987 Romstar/Capcom USA
  4.  
  5. Please contact Phil Stroffolino (phil@maya.com) if there are any questions
  6. regarding this driver.
  7.  
  8. F1 Dream protection workaround by Eric Hustvedt
  9.  
  10. Memory Overview:
  11.     0xfe0800    sprites
  12.     0xfec000    text
  13.     0xfe4000    input ports,dip switches (read); sound out, video reg (write)
  14.     0xfe4002    protection (F1 Dream only)
  15.     0xfe8000    scroll registers
  16.     0xff8200    palette
  17.     0xffC000    working RAM
  18.     0xffEC70    high scores (not saved)
  19.  
  20. ***************************************************************************/
  21.  
  22. #include "driver.h"
  23. #include "vidhrdw/generic.h"
  24. #include "cpu/z80/z80.h"
  25.  
  26.  
  27. WRITE_HANDLER( tigeroad_videoctrl_w );
  28. WRITE_HANDLER( tigeroad_scroll_w );
  29. void tigeroad_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  30.  
  31.  
  32. static unsigned char *ram;
  33.  
  34. /*
  35.  F1 Dream protection code written by Eric Hustvedt (hustvedt@ma.ultranet.com).
  36.  
  37.  The genuine F1 Dream game uses an 8751 microcontroller as a protection measure.
  38.  Since the microcontroller's ROM is unavailable all interactions with it are handled
  39.  via blackbox algorithm.
  40.  
  41.  Some notes:
  42.  - The 8751 is triggered via location 0xfe4002, in place of the soundlatch normally
  43.      present. The main cpu writes 0 to the location when it wants the 8751 to perform some work.
  44.  - The 8751 has memory which shadows locations 0xffffe0-0xffffff of the main cpu's address space.
  45.  - The word at 0xffffe0 contains an 'opcode' which is written just before the write to 0xfe4002.
  46.  - Some of the writes to the soundlatch may not be handled. 0x27fc is the main sound routine, the
  47.      other locations are less frequently used.
  48. */
  49.  
  50. static int f1dream_613ea_lookup[16] = {
  51. 0x0052, 0x0031, 0x00a7, 0x0043, 0x0007, 0x008a, 0x00b1, 0x0066, 0x009f, 0x00cc, 0x0009, 0x004d, 0x0033, 0x0028, 0x00d0, 0x0025};
  52.  
  53. static int f1dream_613eb_lookup[256] = {
  54. 0x0001, 0x00b5, 0x00b6, 0x00b6, 0x00b6, 0x00b6, 0x00b6, 0x00b6, 0x00b7, 0x0001, 0x00b8, 0x002f, 0x002f, 0x002f, 0x002f, 0x00b9,
  55. 0x00aa, 0x0031, 0x00ab, 0x00ab, 0x00ab, 0x00ac, 0x00ad, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x0091,
  56. 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x009b, 0x0091,
  57. 0x00bc, 0x0092, 0x000b, 0x0009, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0073, 0x0001, 0x0098, 0x0099, 0x009a, 0x009b, 0x0091,
  58. 0x00bc, 0x007b, 0x000b, 0x0008, 0x0087, 0x0088, 0x0089, 0x008a, 0x007f, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091,
  59. 0x00bd, 0x007b, 0x000b, 0x0007, 0x007c, 0x007d, 0x007e, 0x0001, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086,
  60. 0x00bc, 0x0070, 0x000b, 0x0006, 0x0071, 0x0072, 0x0073, 0x0001, 0x0074, 0x000d, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a,
  61. 0x00bc, 0x00ba, 0x000a, 0x0005, 0x0065, 0x0066, 0x0067, 0x0068, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
  62. 0x00bc, 0x0059, 0x0001, 0x0004, 0x005a, 0x005b, 0x0001, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064,
  63. 0x0014, 0x004d, 0x0001, 0x0003, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0001, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058,
  64. 0x0014, 0x0043, 0x0001, 0x0002, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x00bb, 0x004a, 0x004b, 0x004c, 0x0001, 0x0001,
  65. 0x0014, 0x002b, 0x0001, 0x0038, 0x0039, 0x003a, 0x003b, 0x0031, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0001,
  66. 0x0014, 0x002d, 0x0001, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0001, 0x0014, 0x0037, 0x0001,
  67. 0x0014, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x0001, 0x0001, 0x0001, 0x002a, 0x002b, 0x002c,
  68. 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001e, 0x001e, 0x001e, 0x001f, 0x0020,
  69. 0x000c, 0x000d, 0x000e, 0x0001, 0x000f, 0x0010, 0x0011, 0x0012, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x0013 };
  70.  
  71. static int f1dream_17b74_lookup[128] = {
  72. 0x0003, 0x0040, 0x0005, 0x0080, 0x0003, 0x0080, 0x0005, 0x00a0, 0x0003, 0x0040, 0x0005, 0x00c0, 0x0003, 0x0080, 0x0005, 0x00e0,
  73. 0x0003, 0x0040, 0x0006, 0x0000, 0x0003, 0x0080, 0x0006, 0x0020, 0x0003, 0x0040, 0x0006, 0x0040, 0x0003, 0x0080, 0x0006, 0x0060,
  74. 0x0000, 0x00a0, 0x0009, 0x00e0, 0x0000, 0x00e0, 0x000a, 0x0000, 0x0000, 0x00a0, 0x000a, 0x0020, 0x0000, 0x00e0, 0x000a, 0x0040,
  75. 0x0000, 0x00a0, 0x000a, 0x0060, 0x0000, 0x00e0, 0x000a, 0x0080, 0x0000, 0x00a0, 0x000a, 0x00a0, 0x0000, 0x00e0, 0x000a, 0x00c0,
  76. 0x0003, 0x0040, 0x0005, 0x0080, 0x0003, 0x0080, 0x0005, 0x00a0, 0x0003, 0x0040, 0x0005, 0x00c0, 0x0003, 0x0080, 0x0005, 0x00e0,
  77. 0x0003, 0x0040, 0x0006, 0x0000, 0x0003, 0x0080, 0x0006, 0x0020, 0x0003, 0x0040, 0x0006, 0x0040, 0x0003, 0x0080, 0x0006, 0x0060,
  78. 0x0000, 0x00a0, 0x0009, 0x00e0, 0x0000, 0x00e0, 0x000a, 0x0000, 0x0000, 0x00a0, 0x000a, 0x0020, 0x0000, 0x00e0, 0x000a, 0x0040,
  79. 0x0000, 0x00a0, 0x000a, 0x0060, 0x0000, 0x00e0, 0x000a, 0x0080, 0x0000, 0x00a0, 0x000a, 0x00a0, 0x0000, 0x00e0, 0x000a, 0x00c0 };
  80.  
  81. static int f1dream_2450_lookup[32] = {
  82. 0x0003, 0x0080, 0x0006, 0x0060, 0x0000, 0x00e0, 0x000a, 0x00c0, 0x0003, 0x0080, 0x0006, 0x0060, 0x0000, 0x00e0, 0x000a, 0x00c0,
  83. 0x0003, 0x0080, 0x0006, 0x0060, 0x0000, 0x00e0, 0x000a, 0x00c0, 0x0003, 0x0080, 0x0006, 0x0060, 0x0000, 0x00e0, 0x000a, 0x00c0 };
  84.  
  85. static void f1dream_protection_w(void)
  86. {
  87.     int indx;
  88.     int value = 255;
  89.     int prevpc = cpu_getpreviouspc();
  90.  
  91.     if (prevpc == 0x244c)
  92.     {
  93.         /* Called once, when a race is started.*/
  94.         indx = READ_WORD(&ram[0x3ff0]);
  95.         WRITE_WORD(&ram[0x3fe6],f1dream_2450_lookup[indx]);
  96.         WRITE_WORD(&ram[0x3fe8],f1dream_2450_lookup[++indx]);
  97.         WRITE_WORD(&ram[0x3fea],f1dream_2450_lookup[++indx]);
  98.         WRITE_WORD(&ram[0x3fec],f1dream_2450_lookup[++indx]);
  99.     }
  100.     else if (prevpc == 0x613a)
  101.     {
  102.         /* Called for every sprite on-screen.*/
  103.         if ((READ_WORD(&ram[0x3ff6])) < 15)
  104.         {
  105.             indx = f1dream_613ea_lookup[READ_WORD(&ram[0x3ff6])] - (READ_WORD(&ram[0x3ff4]));
  106.             if (indx > 255)
  107.             {
  108.                 indx <<= 4;
  109.                 indx += READ_WORD(&ram[0x3ff6]) & 0x00ff;
  110.                 value = f1dream_613eb_lookup[indx];
  111.             }
  112.         }
  113.  
  114.         WRITE_WORD(&ram[0x3ff2],value);
  115.     }
  116.     else if (prevpc == 0x17b70)
  117.     {
  118.         /* Called only before a real race, not a time trial.*/
  119.         if ((READ_WORD(&ram[0x3ff0])) >= 0x04) indx = 128;
  120.         else if ((READ_WORD(&ram[0x3ff0])) > 0x02) indx = 96;
  121.         else if ((READ_WORD(&ram[0x3ff0])) == 0x02) indx = 64;
  122.         else if ((READ_WORD(&ram[0x3ff0])) == 0x01) indx = 32;
  123.         else indx = 0;
  124.  
  125.         indx += READ_WORD(&ram[0x3fee]);
  126.         if (indx < 128)
  127.         {
  128.             WRITE_WORD(&ram[0x3fe6],f1dream_17b74_lookup[indx]);
  129.             WRITE_WORD(&ram[0x3fe8],f1dream_17b74_lookup[++indx]);
  130.             WRITE_WORD(&ram[0x3fea],f1dream_17b74_lookup[++indx]);
  131.             WRITE_WORD(&ram[0x3fec],f1dream_17b74_lookup[++indx]);
  132.         }
  133.         else
  134.         {
  135.             WRITE_WORD(&ram[0x3fe6],0x00ff);
  136.             WRITE_WORD(&ram[0x3fe8],0x00ff);
  137.             WRITE_WORD(&ram[0x3fea],0x00ff);
  138.             WRITE_WORD(&ram[0x3fec],0x00ff);
  139.         }
  140.     }
  141.     else if ((prevpc == 0x27f8) || (prevpc == 0x511a) || (prevpc == 0x5142) || (prevpc == 0x516a))
  142.     {
  143.         /* The main CPU stuffs the byte for the soundlatch into 0xfffffd.*/
  144.         soundlatch_w(2,READ_WORD(&ram[0x3ffc]));
  145.     }
  146. }
  147.  
  148. static WRITE_HANDLER( f1dream_control_w )
  149. {
  150.     logerror("protection write, PC: %04x  FFE1 Value:%01x\n",cpu_get_pc(), ram[0x3fe1]);
  151.     f1dream_protection_w();
  152. }
  153.  
  154. static WRITE_HANDLER( tigeroad_soundcmd_w )
  155. {
  156.     if ((data & 0xff000000) == 0)
  157.         soundlatch_w(offset,(data >> 8) & 0xff);
  158. }
  159.  
  160. static WRITE_HANDLER( msm5205_w )
  161. {
  162.     MSM5205_reset_w(offset,(data>>7)&1);
  163.     MSM5205_data_w(offset,data);
  164.     MSM5205_vclk_w(offset,1);
  165.     MSM5205_vclk_w(offset,0);
  166. }
  167.  
  168. int tigeroad_interrupt(void)
  169. {
  170.     return 2;
  171. }
  172.  
  173.  
  174. /***************************************************************************/
  175.  
  176. static struct MemoryReadAddress readmem[] =
  177. {
  178.     { 0x000000, 0x03ffff, MRA_ROM },
  179.     { 0xfe0800, 0xfe0cff, MRA_BANK1 },
  180.     { 0xfe0d00, 0xfe1807, MRA_BANK2 },
  181.     { 0xfe4000, 0xfe4001, input_port_0_r },
  182.     { 0xfe4002, 0xfe4003, input_port_1_r },
  183.     { 0xfe4004, 0xfe4005, input_port_2_r },
  184.     { 0xfec000, 0xfec7ff, MRA_BANK3 },
  185.     { 0xff8200, 0xff867f, paletteram_word_r },
  186.     { 0xffc000, 0xffffff, MRA_BANK4 },
  187.     { -1 }  /* end of table */
  188. };
  189.  
  190. static struct MemoryWriteAddress writemem[] =
  191. {
  192.     { 0x000000, 0x03ffff, MWA_ROM },
  193.     { 0xfe0800, 0xfe0cff, MWA_BANK1, &spriteram, &spriteram_size },
  194.     { 0xfe0d00, 0xfe1807, MWA_BANK2 },  /* still part of OBJ RAM */
  195.     { 0xfe4000, 0xfe4001, tigeroad_videoctrl_w },    /* char bank, coin counters, + ? */
  196.     /*{ 0xfe4002, 0xfe4003, tigeroad_soundcmd_w }, added by init_tigeroad() */
  197.     { 0xfec000, 0xfec7ff, MWA_BANK3, &videoram, &videoram_size },
  198.     { 0xfe8000, 0xfe8003, tigeroad_scroll_w },
  199.     { 0xfe800e, 0xfe800f, MWA_NOP },    /* fe800e = watchdog or IRQ acknowledge */
  200.     { 0xff8200, 0xff867f, paletteram_xxxxRRRRGGGGBBBB_word_w, &paletteram },
  201.     { 0xffc000, 0xffffff, MWA_BANK4, &ram },
  202.     { -1 }  /* end of table */
  203. };
  204.  
  205. static struct MemoryReadAddress sound_readmem[] =
  206. {
  207.     { 0x0000, 0x7fff, MRA_ROM },
  208.     { 0x8000, 0x8000, YM2203_status_port_0_r },
  209.     { 0xa000, 0xa000, YM2203_status_port_1_r },
  210.     { 0xc000, 0xc7ff, MRA_RAM },
  211.     { 0xe000, 0xe000, soundlatch_r },
  212.     { -1 }  /* end of table */
  213. };
  214.  
  215. static struct MemoryWriteAddress sound_writemem[] =
  216. {
  217.     { 0x0000, 0x7fff, MWA_ROM },
  218.     { 0x8000, 0x8000, YM2203_control_port_0_w },
  219.     { 0x8001, 0x8001, YM2203_write_port_0_w },
  220.     { 0xa000, 0xa000, YM2203_control_port_1_w },
  221.     { 0xa001, 0xa001, YM2203_write_port_1_w },
  222.     { 0xc000, 0xc7ff, MWA_RAM },
  223.     { -1 }  /* end of table */
  224. };
  225.  
  226. static struct IOWritePort sound_writeport[] =
  227. {
  228.     { 0x7f, 0x7f, soundlatch2_w },
  229.     { -1 }  /* end of table */
  230. };
  231.  
  232. static struct MemoryReadAddress sample_readmem[] =
  233. {
  234.     { 0x0000, 0xffff, MRA_ROM },
  235.     { -1 }  /* end of table */
  236. };
  237.  
  238. /* yes, no RAM */
  239. static struct MemoryWriteAddress sample_writemem[] =
  240. {
  241.     { 0x0000, 0xffff, MWA_ROM },
  242.     { -1 }  /* end of table */
  243. };
  244.  
  245. static struct IOReadPort sample_readport[] =
  246. {
  247.     { 0x00, 0x00, soundlatch2_r },
  248.     { -1 }  /* end of table */
  249. };
  250.  
  251. static struct IOWritePort sample_writeport[] =
  252. {
  253.     { 0x01, 0x01, msm5205_w },
  254.     { -1 }  /* end of table */
  255. };
  256.  
  257.  
  258.  
  259. INPUT_PORTS_START( tigeroad )
  260.     PORT_START  /* IN0 */
  261.     PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  262.     PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
  263.     PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
  264.     PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
  265.     PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 )
  266.     PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 )
  267.     PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
  268.     PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
  269.     PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  270.     PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
  271.     PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
  272.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
  273.     PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  274.     PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  275.     PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  276.     PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  277.  
  278.     PORT_START
  279.     PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
  280.     PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
  281.     PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
  282.     PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
  283.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
  284.     PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  285.     PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN3 )
  286.     PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN1 )
  287.     PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN2 )
  288.  
  289.     PORT_START  /* dipswitch */
  290.     PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_B ) )
  291.     PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
  292.     PORT_DIPSETTING(      0x0001, DEF_STR( 3C_1C ) )
  293.     PORT_DIPSETTING(      0x0002, DEF_STR( 2C_1C ) )
  294.     PORT_DIPSETTING(      0x0007, DEF_STR( 1C_1C ) )
  295.     PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
  296.     PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
  297.     PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
  298.     PORT_DIPSETTING(      0x0003, DEF_STR( 1C_6C ) )
  299.     PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_A ) )
  300.     PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
  301.     PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )
  302.     PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
  303.     PORT_DIPSETTING(      0x0038, DEF_STR( 1C_1C ) )
  304.     PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
  305.     PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
  306.     PORT_DIPSETTING(      0x0020, DEF_STR( 1C_4C ) )
  307.     PORT_DIPSETTING(      0x0018, DEF_STR( 1C_6C ) )
  308.     PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
  309.     PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )
  310.     PORT_DIPSETTING(      0x0080, DEF_STR( Off ))
  311.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  312.     PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
  313.     PORT_DIPSETTING(      0x0300, "3" )
  314.     PORT_DIPSETTING(      0x0200, "4" )
  315.     PORT_DIPSETTING(      0x0100, "5" )
  316.     PORT_DIPSETTING(      0x0000, "7" )
  317.     PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Cabinet ) )
  318.     PORT_DIPSETTING(      0x0000, DEF_STR( Upright ))
  319.     PORT_DIPSETTING(      0x0400, DEF_STR( Cocktail ))
  320.     PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Bonus_Life ) )
  321.     PORT_DIPSETTING(      0x1800, "20000 70000 70000" )
  322.     PORT_DIPSETTING(      0x1000, "20000 80000 80000" )
  323.     PORT_DIPSETTING(      0x0800, "30000 80000 80000" )
  324.     PORT_DIPSETTING(      0x0000, "30000 90000 90000" )
  325.     PORT_DIPNAME( 0x6000, 0x6000, DEF_STR( Difficulty ) )
  326.     PORT_DIPSETTING(      0x2000, "Very Easy" )
  327.     PORT_DIPSETTING(      0x4000, "Easy" )
  328.     PORT_DIPSETTING(      0x6000, "Normal" )
  329.     PORT_DIPSETTING(      0x0000, "Difficult" )
  330.     PORT_DIPNAME( 0x8000, 0x8000, "Allow Continue" )
  331.     PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
  332.     PORT_DIPSETTING(      0x8000, DEF_STR( Yes ) )
  333. INPUT_PORTS_END
  334.  
  335. INPUT_PORTS_START( toramich )
  336.     PORT_START  /* IN0 */
  337.     PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  338.     PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
  339.     PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
  340.     PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
  341.     PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 )
  342.     PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 )
  343.     PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
  344.     PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
  345.     PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  346.     PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
  347.     PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
  348.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
  349.     PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  350.     PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  351.     PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  352.     PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  353.  
  354.     PORT_START
  355.     PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
  356.     PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
  357.     PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
  358.     PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
  359.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
  360.     PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  361.     PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN3 )
  362.     PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN1 )
  363.     PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN2 )
  364.  
  365.     PORT_START  /* dipswitch */
  366.     PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_B ) )
  367.     PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
  368.     PORT_DIPSETTING(      0x0001, DEF_STR( 3C_1C ) )
  369.     PORT_DIPSETTING(      0x0002, DEF_STR( 2C_1C ) )
  370.     PORT_DIPSETTING(      0x0007, DEF_STR( 1C_1C ) )
  371.     PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
  372.     PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
  373.     PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
  374.     PORT_DIPSETTING(      0x0003, DEF_STR( 1C_6C ) )
  375.     PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_A ) )
  376.     PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
  377.     PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )
  378.     PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
  379.     PORT_DIPSETTING(      0x0038, DEF_STR( 1C_1C ) )
  380.     PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
  381.     PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
  382.     PORT_DIPSETTING(      0x0020, DEF_STR( 1C_4C ) )
  383.     PORT_DIPSETTING(      0x0018, DEF_STR( 1C_6C ) )
  384.     PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
  385.     PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )
  386.     PORT_DIPSETTING(      0x0080, DEF_STR( Off ))
  387.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  388.     PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
  389.     PORT_DIPSETTING(      0x0300, "3" )
  390.     PORT_DIPSETTING(      0x0200, "4" )
  391.     PORT_DIPSETTING(      0x0100, "5" )
  392.     PORT_DIPSETTING(      0x0000, "7" )
  393.     PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Cabinet ) )
  394.     PORT_DIPSETTING(      0x0000, DEF_STR( Upright ))
  395.     PORT_DIPSETTING(      0x0400, DEF_STR( Cocktail ))
  396.     PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Bonus_Life ) )
  397.     PORT_DIPSETTING(      0x0800, "20000 70000 70000" )
  398.     PORT_DIPSETTING(      0x0000, "20000 80000 80000" )
  399.     PORT_DIPNAME( 0x1000, 0x1000, "Allow Level Select" )
  400.     PORT_DIPSETTING(      0x1000, DEF_STR( No ) )
  401.     PORT_DIPSETTING(      0x0000, DEF_STR( Yes ) )
  402.     PORT_DIPNAME( 0x6000, 0x6000, DEF_STR( Difficulty ) )
  403.     PORT_DIPSETTING(      0x4000, "Easy" )
  404.     PORT_DIPSETTING(      0x6000, "Normal" )
  405.     PORT_DIPSETTING(      0x2000, "Difficult" )
  406.     PORT_DIPSETTING(      0x0000, "Very Difficult" )
  407.     PORT_DIPNAME( 0x8000, 0x8000, "Allow Continue" )
  408.     PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
  409.     PORT_DIPSETTING(      0x8000, DEF_STR( Yes ) )
  410. INPUT_PORTS_END
  411.  
  412. INPUT_PORTS_START( f1dream )
  413.     PORT_START  /* IN0 */
  414.     PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  415.     PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
  416.     PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
  417.     PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
  418.     PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 )
  419.     PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 )
  420.     PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
  421.     PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
  422.     PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  423.     PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
  424.     PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
  425.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
  426.     PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  427.     PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  428.     PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  429.     PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  430.  
  431.     PORT_START
  432.     PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
  433.     PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
  434.     PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
  435.     PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
  436.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
  437.     PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
  438.     PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN3 )
  439.     PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN1 )
  440.     PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN2 )
  441.  
  442.     PORT_START  /* dipswitch */
  443.     PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_B ) )
  444.     PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
  445.     PORT_DIPSETTING(      0x0001, DEF_STR( 3C_1C ) )
  446.     PORT_DIPSETTING(      0x0002, DEF_STR( 2C_1C ) )
  447.     PORT_DIPSETTING(      0x0007, DEF_STR( 1C_1C ) )
  448.     PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
  449.     PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
  450.     PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
  451.     PORT_DIPSETTING(      0x0003, DEF_STR( 1C_6C ) )
  452.     PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_A ) )
  453.     PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
  454.     PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )
  455.     PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
  456.     PORT_DIPSETTING(      0x0038, DEF_STR( 1C_1C ) )
  457.     PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
  458.     PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
  459.     PORT_DIPSETTING(      0x0020, DEF_STR( 1C_4C ) )
  460.     PORT_DIPSETTING(      0x0018, DEF_STR( 1C_6C ) )
  461.     PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
  462.     PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )
  463.     PORT_DIPSETTING(      0x0080, DEF_STR( Off ))
  464.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  465.     PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
  466.     PORT_DIPSETTING(      0x0300, "3" )
  467.     PORT_DIPSETTING(      0x0200, "4" )
  468.     PORT_DIPSETTING(      0x0100, "5" )
  469.     PORT_DIPSETTING(      0x0000, "7" )
  470.     PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Cabinet ) )
  471.     PORT_DIPSETTING(      0x0000, DEF_STR( Upright ))
  472.     PORT_DIPSETTING(      0x0400, DEF_STR( Cocktail ))
  473.     PORT_DIPNAME( 0x1800, 0x1800, "F1 Up Point" )
  474.     PORT_DIPSETTING(      0x1800, "12" )
  475.     PORT_DIPSETTING(      0x1000, "16" )
  476.     PORT_DIPSETTING(      0x0800, "18" )
  477.     PORT_DIPSETTING(      0x0000, "20" )
  478.     PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Difficulty ) )
  479.     PORT_DIPSETTING(      0x2000, "Normal" )
  480.     PORT_DIPSETTING(      0x0000, "Difficult" )
  481.     PORT_DIPNAME( 0x4000, 0x0000, "Version" )
  482.     PORT_DIPSETTING(      0x0000, "International" )
  483.     PORT_DIPSETTING(      0x4000, "Japan" )
  484.     PORT_DIPNAME( 0x8000, 0x8000, "Allow Continue" )
  485.     PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
  486.     PORT_DIPSETTING(      0x8000, DEF_STR( Yes ) )
  487. INPUT_PORTS_END
  488.  
  489.  
  490.  
  491. static struct GfxLayout text_layout =
  492. {
  493.     8,8,    /* character size */
  494.     2048,   /* number of characters */
  495.     2,      /* bits per pixel */
  496.     { 4, 0 }, /* plane offsets */
  497.     { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3 }, /* x offsets */
  498.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 }, /* y offsets */
  499.     16*8
  500. };
  501.  
  502. static struct GfxLayout tile_layout =
  503. {
  504.     32,32,  /* tile size */
  505.     2048,   /* number of tiles */
  506.     4,      /* bits per pixel */
  507.  
  508.     { 2048*256*8+4, 2048*256*8+0, 4, 0 },
  509.  
  510.     { /* x offsets */
  511.         0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3,
  512.         64*8+0, 64*8+1, 64*8+2, 64*8+3, 64*8+8+0, 64*8+8+1, 64*8+8+2, 64*8+8+3,
  513.         2*64*8+0, 2*64*8+1, 2*64*8+2, 2*64*8+3, 2*64*8+8+0, 2*64*8+8+1, 2*64*8+8+2, 2*64*8+8+3,
  514.         3*64*8+0, 3*64*8+1, 3*64*8+2, 3*64*8+3, 3*64*8+8+0, 3*64*8+8+1, 3*64*8+8+2, 3*64*8+8+3,
  515.     },
  516.  
  517.     { /* y offsets */
  518.         0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
  519.         8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16,
  520.         16*16, 17*16, 18*16, 19*16, 20*16, 21*16, 22*16, 23*16,
  521.         24*16, 25*16, 26*16, 27*16, 28*16, 29*16, 30*16, 31*16
  522.     },
  523.  
  524.     256*8
  525. };
  526.  
  527. static struct GfxLayout sprite_layout =
  528. {
  529.     16,16,  /* tile size */
  530.     4096,   /* number of tiles */
  531.     4,      /* bits per pixel */
  532.     { 3*4096*32*8, 2*4096*32*8, 1*4096*32*8, 0*4096*32*8 }, /* plane offsets */
  533.     { /* x offsets */
  534.         0, 1, 2, 3, 4, 5, 6, 7,
  535.         16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7
  536.     },
  537.     { /* y offsets */
  538.         0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  539.         8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8
  540.     },
  541.     32*8
  542. };
  543.  
  544. static struct GfxDecodeInfo gfxdecodeinfo[] =
  545. {
  546.     { REGION_GFX1, 0, &text_layout,   512, 16 },   /* colors 512-575 */
  547.     { REGION_GFX2, 0, &tile_layout,     0, 16 },   /* colors   0-255 */
  548.     { REGION_GFX3, 0, &sprite_layout, 256, 16 },   /* colors 256-511 */
  549.     { -1 } /* end of array */
  550. };
  551.  
  552.  
  553.  
  554. /* handler called by the 2203 emulator when the internal timers cause an IRQ */
  555. static void irqhandler(int irq)
  556. {
  557.     cpu_set_irq_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE);
  558. }
  559.  
  560. static struct YM2203interface ym2203_interface =
  561. {
  562.     2,          /* 2 chips */
  563.     3579545,    /* 3.579 MHz ? */
  564.     { YM2203_VOL(25,25), YM2203_VOL(25,25) },
  565.     { 0 },
  566.     { 0 },
  567.     { 0 },
  568.     { 0 },
  569.     { irqhandler }
  570. };
  571.  
  572. static struct MSM5205interface msm5205_interface =
  573. {
  574.     1,        /* 1 chip */
  575.     384000,    /* 384KHz ? */
  576.     { 0 },    /* interrupt function */
  577.     { MSM5205_SEX_4B },    /* 4KHz playback ?  */
  578.     { 100 }
  579. };
  580.  
  581.  
  582. static struct MachineDriver machine_driver_tigeroad =
  583. {
  584.     {
  585.         {
  586.             CPU_M68000,
  587.             6000000, /* ? Main clock is 24MHz */
  588.             readmem,writemem,0,0,
  589.             tigeroad_interrupt,1
  590.         },
  591.         {
  592.             CPU_Z80 | CPU_AUDIO_CPU,
  593.             4000000,    /* 4 Mhz ??? */
  594.             sound_readmem,sound_writemem,0,sound_writeport,
  595.             ignore_interrupt,0  /* NMIs are triggered by the main CPU */
  596.                                 /* IRQs are triggered by the YM2203 */
  597.         }
  598.     },
  599.     60, 2500,   /* frames per second, vblank duration */
  600.                 /* vblank duration hand tuned to get proper sprite/background alignment */
  601.     1,  /* CPU slices per frame */
  602.     0,
  603.  
  604.     /* video hardware */
  605.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  606.     gfxdecodeinfo,
  607.     576, 576,
  608.     0, /* convert color prom routine */
  609.  
  610.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_AFTER_VBLANK,
  611.     0,
  612.     0,
  613.     0,
  614.     tigeroad_vh_screenrefresh,
  615.  
  616.     /* sound hardware */
  617.     0,0,0,0,
  618.     {
  619.         {
  620.             SOUND_YM2203,
  621.             &ym2203_interface
  622.         }
  623.     }
  624. };
  625.  
  626. /* same as above but with additional Z80 for samples playback */
  627. static struct MachineDriver machine_driver_toramich =
  628. {
  629.     {
  630.         {
  631.             CPU_M68000,
  632.             6000000, /* ? Main clock is 24MHz */
  633.             readmem,writemem,0,0,
  634.             tigeroad_interrupt,1
  635.         },
  636.         {
  637.             CPU_Z80 | CPU_AUDIO_CPU,
  638.             4000000,    /* 4 Mhz ??? */
  639.             sound_readmem,sound_writemem,0,sound_writeport,
  640.             ignore_interrupt,0  /* NMIs are triggered by the main CPU */
  641.                                 /* IRQs are triggered by the YM2203 */
  642.         },
  643.         {
  644.             CPU_Z80 | CPU_AUDIO_CPU,
  645.             3579545,    /* ? */
  646.             sample_readmem,sample_writemem,sample_readport,sample_writeport,
  647.             0,0,
  648.             interrupt,4000    /* ? */
  649.         }
  650.     },
  651.     60, 2500,   /* frames per second, vblank duration */
  652.                 /* vblank duration hand tuned to get proper sprite/background alignment */
  653.     1,  /* CPU slices per frame */
  654.     0,
  655.  
  656.     /* video hardware */
  657.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  658.     gfxdecodeinfo,
  659.     576, 576,
  660.     0, /* convert color prom routine */
  661.  
  662.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_AFTER_VBLANK,
  663.     0,
  664.     0,
  665.     0,
  666.     tigeroad_vh_screenrefresh,
  667.  
  668.     /* sound hardware */
  669.     0,0,0,0,
  670.     {
  671.         {
  672.             SOUND_YM2203,
  673.             &ym2203_interface
  674.         },
  675.         {
  676.             SOUND_MSM5205,
  677.             &msm5205_interface
  678.         }
  679.     }
  680. };
  681.  
  682.  
  683.  
  684. /***************************************************************************
  685.  
  686.   Game driver(s)
  687.  
  688. ***************************************************************************/
  689.  
  690. ROM_START( tigeroad )
  691.     ROM_REGION( 0x40000, REGION_CPU1 ) /* 256K for 68000 code */
  692.     ROM_LOAD_EVEN( "tru02.bin",    0x00000, 0x20000, 0x8d283a95 )
  693.     ROM_LOAD_ODD ( "tru04.bin",    0x00000, 0x20000, 0x72e2ef20 )
  694.  
  695.     ROM_REGION( 0x10000, REGION_CPU2 ) /* audio CPU */
  696.     ROM_LOAD( "tru05.bin",    0x0000, 0x8000, 0xf9a7c9bf )
  697.  
  698.     /* no samples player in the English version */
  699.  
  700.     ROM_REGION( 0x008000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  701.     ROM_LOAD( "tr01.bin",     0x00000, 0x08000, 0x74a9f08c ) /* 8x8 text */
  702.  
  703.     ROM_REGION( 0x100000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  704.     ROM_LOAD( "tr-01a.bin",   0x00000, 0x20000, 0xa8aa2e59 ) /* tiles */
  705.     ROM_LOAD( "tr-04a.bin",   0x20000, 0x20000, 0x8863a63c )
  706.     ROM_LOAD( "tr-02a.bin",   0x40000, 0x20000, 0x1a2c5f89 )
  707.     ROM_LOAD( "tr05.bin",     0x60000, 0x20000, 0x5bf453b3 )
  708.     ROM_LOAD( "tr-03a.bin",   0x80000, 0x20000, 0x1e0537ea )
  709.     ROM_LOAD( "tr-06a.bin",   0xa0000, 0x20000, 0xb636c23a )
  710.     ROM_LOAD( "tr-07a.bin",   0xc0000, 0x20000, 0x5f907d4d )
  711.     ROM_LOAD( "tr08.bin",     0xe0000, 0x20000, 0xadee35e2 )
  712.  
  713.     ROM_REGION( 0x080000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  714.     ROM_LOAD( "tr-09a.bin",   0x00000, 0x20000, 0x3d98ad1e ) /* sprites */
  715.     ROM_LOAD( "tr-10a.bin",   0x20000, 0x20000, 0x8f6f03d7 )
  716.     ROM_LOAD( "tr-11a.bin",   0x40000, 0x20000, 0xcd9152e5 )
  717.     ROM_LOAD( "tr-12a.bin",   0x60000, 0x20000, 0x7d8a99d0 )
  718.  
  719.     ROM_REGION( 0x08000, REGION_GFX4 )    /* background tilemaps */
  720.     ROM_LOAD( "tr13.bin",     0x0000, 0x8000, 0xa79be1eb )
  721.  
  722.     ROM_REGION( 0x0100, REGION_PROMS )
  723.     ROM_LOAD( "trprom.bin",   0x0000, 0x0100, 0xec80ae36 )    /* unknown (palette bank select?) */
  724. ROM_END
  725.  
  726. ROM_START( toramich )
  727.     ROM_REGION( 0x40000, REGION_CPU1 ) /* 256K for 68000 code */
  728.     ROM_LOAD_EVEN( "tr_02.bin",    0x00000, 0x20000, 0xb54723b1 )
  729.     ROM_LOAD_ODD ( "tr_04.bin",    0x00000, 0x20000, 0xab432479 )
  730.  
  731.     ROM_REGION( 0x10000, REGION_CPU2 ) /* audio CPU */
  732.     ROM_LOAD( "tr_05.bin",    0x0000, 0x8000, 0x3ebe6e62 )
  733.  
  734.     ROM_REGION( 0x10000, REGION_CPU3 ) /* samples player */
  735.     ROM_LOAD( "tr_03.bin",    0x0000, 0x10000, 0xea1807ef )
  736.  
  737.     ROM_REGION( 0x008000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  738.     ROM_LOAD( "tr01.bin",     0x00000, 0x08000, 0x74a9f08c ) /* 8x8 text */
  739.  
  740.     ROM_REGION( 0x100000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  741.     ROM_LOAD( "tr-01a.bin",   0x00000, 0x20000, 0xa8aa2e59 ) /* tiles */
  742.     ROM_LOAD( "tr-04a.bin",   0x20000, 0x20000, 0x8863a63c )
  743.     ROM_LOAD( "tr-02a.bin",   0x40000, 0x20000, 0x1a2c5f89 )
  744.     ROM_LOAD( "tr05.bin",     0x60000, 0x20000, 0x5bf453b3 )
  745.     ROM_LOAD( "tr-03a.bin",   0x80000, 0x20000, 0x1e0537ea )
  746.     ROM_LOAD( "tr-06a.bin",   0xa0000, 0x20000, 0xb636c23a )
  747.     ROM_LOAD( "tr-07a.bin",   0xc0000, 0x20000, 0x5f907d4d )
  748.     ROM_LOAD( "tr08.bin",     0xe0000, 0x20000, 0xadee35e2 )
  749.  
  750.     ROM_REGION( 0x080000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  751.     ROM_LOAD( "tr-09a.bin",   0x00000, 0x20000, 0x3d98ad1e ) /* sprites */
  752.     ROM_LOAD( "tr-10a.bin",   0x20000, 0x20000, 0x8f6f03d7 )
  753.     ROM_LOAD( "tr-11a.bin",   0x40000, 0x20000, 0xcd9152e5 )
  754.     ROM_LOAD( "tr-12a.bin",   0x60000, 0x20000, 0x7d8a99d0 )
  755.  
  756.     ROM_REGION( 0x08000, REGION_GFX4 )    /* background tilemaps */
  757.     ROM_LOAD( "tr13.bin",     0x0000, 0x8000, 0xa79be1eb )
  758.  
  759.     ROM_REGION( 0x0100, REGION_PROMS )
  760.     ROM_LOAD( "trprom.bin",   0x0000, 0x0100, 0xec80ae36 )    /* unknown (palette bank select?) */
  761. ROM_END
  762.  
  763. ROM_START( f1dream )
  764.     ROM_REGION( 0x40000, REGION_CPU1 ) /* 256K for 68000 code */
  765.     ROM_LOAD_EVEN( "06j_02.bin",   0x00000, 0x20000, 0x3c2ec697 )
  766.     ROM_LOAD_ODD ( "06k_03.bin",   0x00000, 0x20000, 0x85ebad91 )
  767.  
  768.     ROM_REGION( 0x10000, REGION_CPU2 ) /* audio CPU */
  769.     ROM_LOAD( "12k_04.bin",   0x0000, 0x8000, 0x4b9a7524 )
  770.  
  771.     ROM_REGION( 0x008000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  772.     ROM_LOAD( "10d_01.bin",   0x00000, 0x08000, 0x361caf00 ) /* 8x8 text */
  773.  
  774.     ROM_REGION( 0x100000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  775.     ROM_LOAD( "03f_12.bin",   0x00000, 0x10000, 0xbc13e43c ) /* tiles */
  776.     ROM_LOAD( "01f_10.bin",   0x10000, 0x10000, 0xf7617ad9 )
  777.     ROM_LOAD( "03h_14.bin",   0x20000, 0x10000, 0xe33cd438 )
  778.     /* 30000-7ffff empty */
  779.     ROM_LOAD( "02f_11.bin",   0x80000, 0x10000, 0x4aa49cd7 )
  780.     ROM_LOAD( "17f_09.bin",   0x90000, 0x10000, 0xca622155 )
  781.     ROM_LOAD( "02h_13.bin",   0xa0000, 0x10000, 0x2a63961e )
  782.     /* b0000-fffff empty */
  783.  
  784.     ROM_REGION( 0x080000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  785.     ROM_LOAD( "03b_06.bin",   0x00000, 0x10000, 0x5e54e391 ) /* sprites */
  786.     /* 10000-1ffff empty */
  787.     ROM_LOAD( "02b_05.bin",   0x20000, 0x10000, 0xcdd119fd )
  788.     /* 30000-3ffff empty */
  789.     ROM_LOAD( "03d_08.bin",   0x40000, 0x10000, 0x811f2e22 )
  790.     /* 50000-5ffff empty */
  791.     ROM_LOAD( "02d_07.bin",   0x60000, 0x10000, 0xaa9a1233 )
  792.     /* 70000-7ffff empty */
  793.  
  794.     ROM_REGION( 0x08000, REGION_GFX4 )    /* background tilemaps */
  795.     ROM_LOAD( "07l_15.bin",   0x0000, 0x8000, 0x978758b7 )
  796.  
  797.     ROM_REGION( 0x0100, REGION_PROMS )
  798.     ROM_LOAD( "09e_tr.bin",   0x0000, 0x0100, 0xec80ae36 )    /* unknown (palette bank select?) */
  799. ROM_END
  800.  
  801. ROM_START( f1dreamb )
  802.     ROM_REGION( 0x40000, REGION_CPU1 ) /* 256K for 68000 code */
  803.     ROM_LOAD_EVEN( "f1d_04.bin",   0x00000, 0x10000, 0x903febad )
  804.     ROM_LOAD_ODD( "f1d_05.bin",   0x00000, 0x10000, 0x666fa2a7 )
  805.     ROM_LOAD_EVEN( "f1d_02.bin",   0x20000, 0x10000, 0x98973c4c )
  806.     ROM_LOAD_ODD( "f1d_03.bin",   0x20000, 0x10000, 0x3d21c78a )
  807.  
  808.     ROM_REGION( 0x10000, REGION_CPU2 ) /* audio CPU */
  809.     ROM_LOAD( "12k_04.bin",   0x0000, 0x8000, 0x4b9a7524 )
  810.  
  811.     ROM_REGION( 0x008000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  812.     ROM_LOAD( "10d_01.bin",   0x00000, 0x08000, 0x361caf00 ) /* 8x8 text */
  813.  
  814.     ROM_REGION( 0x100000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  815.     ROM_LOAD( "03f_12.bin",   0x00000, 0x10000, 0xbc13e43c ) /* tiles */
  816.     ROM_LOAD( "01f_10.bin",   0x10000, 0x10000, 0xf7617ad9 )
  817.     ROM_LOAD( "03h_14.bin",   0x20000, 0x10000, 0xe33cd438 )
  818.     /* 30000-7ffff empty */
  819.     ROM_LOAD( "02f_11.bin",   0x80000, 0x10000, 0x4aa49cd7 )
  820.     ROM_LOAD( "17f_09.bin",   0x90000, 0x10000, 0xca622155 )
  821.     ROM_LOAD( "02h_13.bin",   0xa0000, 0x10000, 0x2a63961e )
  822.     /* b0000-fffff empty */
  823.  
  824.     ROM_REGION( 0x080000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  825.     ROM_LOAD( "03b_06.bin",   0x00000, 0x10000, 0x5e54e391 ) /* sprites */
  826.     /* 10000-1ffff empty */
  827.     ROM_LOAD( "02b_05.bin",   0x20000, 0x10000, 0xcdd119fd )
  828.     /* 30000-3ffff empty */
  829.     ROM_LOAD( "03d_08.bin",   0x40000, 0x10000, 0x811f2e22 )
  830.     /* 50000-5ffff empty */
  831.     ROM_LOAD( "02d_07.bin",   0x60000, 0x10000, 0xaa9a1233 )
  832.     /* 70000-7ffff empty */
  833.  
  834.     ROM_REGION( 0x08000, REGION_GFX4 )    /* background tilemaps */
  835.     ROM_LOAD( "07l_15.bin",   0x0000, 0x8000, 0x978758b7 )
  836.  
  837.     ROM_REGION( 0x0100, REGION_PROMS )
  838.     ROM_LOAD( "09e_tr.bin",   0x0000, 0x0100, 0xec80ae36 )    /* unknown (palette bank select?) */
  839. ROM_END
  840.  
  841.  
  842.  
  843. void init_tigeroad(void)
  844. {
  845.     install_mem_write_handler(0, 0xfe4002, 0xfe4003, tigeroad_soundcmd_w);
  846. }
  847.  
  848. void init_f1dream(void)
  849. {
  850.     install_mem_write_handler(0, 0xfe4002, 0xfe4003, f1dream_control_w);
  851. }
  852.  
  853.  
  854.  
  855. GAMEX( 1987, tigeroad, 0,        tigeroad, tigeroad, tigeroad, ROT0, "Capcom (Romstar license)", "Tiger Road (US)", GAME_NO_COCKTAIL )
  856. GAMEX( 1987, toramich, tigeroad, toramich, toramich, tigeroad, ROT0, "Capcom", "Tora eno Michi (Japan)", GAME_NO_COCKTAIL )
  857.  
  858. /* F1 Dream has an Intel 8751 microcontroller for protection */
  859. GAMEX( 1988, f1dream,  0,        tigeroad, f1dream,  f1dream,  ROT0, "Capcom (Romstar license)", "F-1 Dream", GAME_NO_COCKTAIL )
  860. GAMEX( 1988, f1dreamb, f1dream,  tigeroad, f1dream,  tigeroad, ROT0, "bootleg", "F-1 Dream (bootleg)", GAME_NO_COCKTAIL )
  861.